﻿namespace Centido.Core.Test
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// Small integer table column testing
    /// </summary>
    [TestClass]
    public class SmallIntColumnTest : ColumnBaseTest<short?>
    {
        /// <summary>
        /// Get column type
        /// </summary>
        /// <returns></returns>
        protected override ColumnType GetColumnType()
        {
            return ColumnType.SmallInteger;
        }

        /// <summary>
        /// Get large value
        /// </summary>
        /// <returns></returns>
        protected override short? GetLargeValue()
        {
            return 12345;
        }

        /// <summary>
        /// Get small value
        /// </summary>
        /// <returns></returns>
        protected override short? GetSmallValue()
        {
            return -12345;
        }

        /// <summary>
        /// Convert db value
        /// </summary>
        /// <param name="dbValue">Db value</param>
        /// <returns></returns>
        protected override short? ConvertDbValue(object dbValue)
        {
            return DbValue.GetSmallInteger(dbValue);
        }
    }
}